<include file="header" />
    <div class="swiper-container kv">
        <div class="swiper-wrapper">
            <div class="swiper-slide kv_6">
                <img class="ani logoImg" src="__PUBLIC__/images/logo.png"/>
                <div class="fullDiv FromSmallToLarge">
                    <div class="cardUp">
                        <img src="__PUBLIC__/images/card1.png"/>
                        <div>请输入您工会卡正面的后4位卡号:</div>
                        <input type="tel" id="card_num" placeholder="请输入" maxlength="4"/>
                        <img src="__PUBLIC__/images/card2.png"/>
                        <div>请输入您工会卡背面的10位工会会员编号:</div>
                        <input type="text" id="member_num" placeholder="请输入" maxlength="10"/>
                        <div>请输入您本人有效手机号码:<span>(以便工作人员与您联系)</span></div>
                        <input type="tel" id="phone" placeholder="请输入" maxlength="11"/>
                        <button onclick="add()">马上晒照</button>
                        <!-- 弹窗 -->
                        <div class="noticePop">
                            <div class="notiveCon">
                                <div>
                                    <div class="close" onclick="$('.noticePop').hide();">X</div>
                                    <h2>验证失败</h2>
                                    <div class="info"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- layer引入开始 -->
    <script src="__PUBLIC__/layer/mobile/layer.js"></script>
    <script>
        //信息提示框
        function malert(msg,time){
            var durationTime = time ? time : 1.5;
            layer.open({content:msg,time:durationTime});
        }
        //加载动画
        function mload(){
            layer.open({type:2,shadeClose:false});
        }
    </script>
    <!-- layer引入结束 -->
	<script>
        function add() {
            if ($('#card_num').val().length != 4) {
                popTips('请输入4位卡号');return;
            }
            if ($('#member_num').val().length != 10) {
                popTips('请输入10位会员编号');return;
            }
            if (!isMobil($('#phone').val())) {
                popTips('请输入您本人有效手机号码');return;
            }

            mload();
            $.post(
                "<{:U('validate_member')}>",
                {
                    card_num : $('#card_num').val(),
                    member_num : $('#member_num').val(),
                    phone : $('#phone').val(),
                },
                function (res) {
                    if (res.status == 0) {
                        layer.closeAll();
                        popTips(res.info);
                    } else {
                        location.href="<{:U('upload_view')}>";
                    }
                },
                'json'
            );
        }

        //弹框
        function popTips(str) {
            $('.noticePop .info').text(str);
            $('.noticePop').show();
            setTimeout("$('.noticePop').fadeOut()", 2000);
        }

        var mySwiper = new Swiper('.swiper-container',{
            direction : 'vertical',
            width : window.innerWidth,
            height : window.innerHeight,
            onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
                swiperAnimateCache(swiper); //隐藏动画元素 
                swiperAnimate(swiper); //初始化完成开始动画
            }
        });
    </script>
<include file="footer" />